package cgb.day02;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Random;

public class Lianxi {


    public static void main(String[] args) {
        int a[]=new int[5];
        for(int b=0;b<a.length;b++){
            int c=new Random().nextInt(100);
            a[b]=c;


        }

       int p[]= method(a);
        System.out.println(Arrays.toString(a));


    }
    public static int[] method(int []a){
        for(int d=0;d<a.length-1;d++){
            for(int e=0;e<a.length-1;e++){
             if(a[e]>a[e+1]){
                 int t=a[e];
                 a[e]=a[e+1];
                 a[e+1]=t;

             }



            }



        }return a;


    }






}
